<template>
  <div id="content">
    <Row>
      <i-col span="2">&nbsp;</i-col>
      <i-col span="20">
        <Card>
          <p slot="title">
            {{ item.title }}
          </p>
          <a href="#" slot="extra" @click.prevent="returnBackPage">
            返回
          </a>
          <p style="text-align:center;">{{ item.createTime }}</p>
          <p v-html="item.content">
          </p>
        </Card>
      </i-col>
      <i-col span="2">&nbsp;</i-col>
    </Row>
  </div>
</template>
<script>
import { getNoticeDetailApi } from '@/api/api'
export default {
  name: 'NewsInformationDetail',
  data() {
    return {
      id: null,
      item: {}
    }
  },
  created() {
    this.id = this.$route.query.id
    this.getNoticeDetail();
  },
  methods: {
    getNoticeDetail() {
      getNoticeDetailApi(this.id).then(res => {
        this.item = res.data;
      })
    },
    /** 返回上一页 */
    returnBackPage() {
      this.$router.go(-1);
    }
  }
}
</script>
<style scoped>
#content {
  min-height: 500px;
  padding-top: 10px;
}
</style>
